package cn.com.api.mapper.base;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

import org.apache.ibatis.annotations.*;

import cn.com.api.entity.ApiU_match_works;

//DAO
public interface U_match_worksMapperBase {

	// 根据id查看
	@Select("SELECT * FROM U_MATCH_WORKS  WHERE WORKS_ID = #{works_id}")
	public ApiU_match_works findU_match_worksById(Integer works_id);

	// 查看数据集
	@Select("SELECT * FROM U_match_works")
	public List<ApiU_match_works> findU_match_workss();

	// 根据条件查看数据集
	public List<Map<String, Object>> findU_match_workssByMap(HashMap condition);

	// 添加
	@Insert("INSERT INTO U_MATCH_WORKS (MATCH_ID, JOIN_NAME, JOIN_CARD_ID, SEX, MOBILE, PROVINCE, CITY, AREA, ADDRESS, WORKS_NAME, WORKS_DESC, WORKS_TYPE, WORKS_URL, VEDIO_URL, STATUS, REJECT_REASON, EXT1, EXT2, EXT3, EXT4, EXT5, AUDIT_BY, AUDIT_TIME,prize_id,is_great,user_id,sort) VALUES (#{match_id}, #{join_name}, #{join_card_id}, #{sex}, #{mobile}, #{province}, #{city}, #{area}, #{address}, #{works_name}, #{works_desc}, #{works_type}, #{works_url}, #{vedio_url}, #{status}, #{reject_reason}, #{ext1}, #{ext2}, #{ext3}, #{ext4}, #{ext5}, #{audit_by}, #{audit_time},#{prize_id},#{is_great},#{user_id},#{sort})")
	@Options(useGeneratedKeys = true, keyProperty = "works_id")
	public int insertU_match_works(ApiU_match_works u_match_works);

	// 修改
	@Update("UPDATE U_MATCH_WORKS SET MATCH_ID = #{match_id}, JOIN_NAME = #{join_name}, JOIN_CARD_ID = #{join_card_id}, SEX = #{sex}, MOBILE = #{mobile}, PROVINCE = #{province}, CITY = #{city}, AREA = #{area}, ADDRESS = #{address}, WORKS_NAME = #{works_name}, WORKS_DESC = #{works_desc}, WORKS_TYPE = #{works_type}, WORKS_URL = #{works_url}, VEDIO_URL = #{vedio_url}, STATUS = #{status}, REJECT_REASON = #{reject_reason}, EXT1 = #{ext1}, EXT2 = #{ext2}, EXT3 = #{ext3}, EXT4 = #{ext4}, EXT5 = #{ext5}, AUDIT_BY = #{audit_by}, AUDIT_TIME = #{audit_time},prize_id = #{prize_id},is_great = #{is_great},user_id = #{user_id},sort = #{sort} WHERE WORKS_ID = #{works_id}")
	public int updateU_match_works(ApiU_match_works u_match_works);

	// 删除
	@Delete("DELETE FROM U_MATCH_WORKS  WHERE WORKS_ID = #{works_id}")
	public int deleteU_match_works(Integer works_id);

	// Foreign keys revelant

	// region Indexs revelant

}
